<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <!-- Meta Tags -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="wpoceans">
    <!-- Page Title -->
    <title>Home</title>
    <!-- Icon fonts -->
    <link href="${pageContext.request.contextPath}/css/themify-icons.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/flaticon.css" rel="stylesheet">
    <!-- Bootstrap core CSS -->
    <link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
    <!-- Plugins for this template -->
    <link href="${pageContext.request.contextPath}/css/animate.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/owl.carousel.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/owl.theme.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/slick.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/slick-theme.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/odometer-theme-default.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/owl.transitions.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/jquery.fancybox.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/magnific-popup.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/nice-select.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/bootstrap-datepicker.min.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <%--百度地图--%>
    <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=0OzQhGGfkNF8iWsONU6OhdOIZoqr6YYi"></script>
</head>

<body id="home">
    <!-- start page-wrapper -->
    <div class="page-wrapper">
        <!-- start preloader -->
        <div class="preloader">
            <div class="spinner">
                <div class="bounce1"></div>
                <div class="bounce2"></div>
                <div class="bounce3"></div>
            </div>
        </div>
        <!-- end preloader -->
        <!-- 头部开始 -->
        <header id="header">
            <div class="topbar">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col col-md-6 col-sm-7 col-12">
                            <div class="contact-intro">
                                <ul>
                                    <li><a href="#a1"><i class="fi ti-location-pin"></i><span id="address">西安市中软国际</span></a></li>
                                    <li><i class="fi flaticon-email"></i> 122151624@106.com</li>
                                </ul>
                            </div>
                        </div>
                        <div class="col col-md-6 col-sm-5 col-12">
                            <div class="contact-info">
                                <ul>
                                    <li><a href="#"><i class="ti-facebook"></i></a></li>
                                    <li><a href="#"><i class="ti-twitter-alt"></i></a></li>
                                    <li><a href="#"><i class="ti-instagram"></i></a></li>
                                    <li><a href="#"><i class="ti-google"></i></a></li>
                                    <li><a class="theme-btn-s2" href="#">预约房间</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div> <!-- end topbar -->
            <div class="site-header header-style-1">
                <nav class="navigation navbar navbar-default">
                    <div class="container-fluid">
                        <div class="navbar-header">
                            <button type="button" class="open-btn">
                                <span class="sr-only">Toggle navigation</span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                            </button>
                            <a class="navbar-brand" href="index.html"><img src="images/logo.png" alt=""></a>
                        </div>
                        <div id="navbar" class="navbar-collapse collapse navigation-holder">
                        <button class="close-navbar"><i class="ti-close"></i></button>
                            <ul class="nav navbar-nav">
                                <li class="menu-item-has-children">
                                <li><a href="${pageContext.request.contextPath}/index.jsp">首页</a></li>
                                </li>
                                <li class="menu-item-has-children">
                                <li><a href="${pageContext.request.contextPath}/frontController/allRoom">全部房间</a></li>
                                </li>
                                <li class="menu-item-has-children">
                                <li><a href="${pageContext.request.contextPath}/frontController/roomSingle">房间详情</a></li>
                                </li>
                                <li class="menu-item-has-children">
                                <li><a href="${pageContext.request.contextPath}/frontController/service">酒店服务</a></li>
                                </li>
                            </ul>
                    </div><!-- 导航栏结束 -->
                        <div class="cart-search-contact">
                            <div class="get-quote">
                                <a href="#"><i class="fi flaticon-support-1"></i>Call : +0123-456-789</a>
                            </div>
                            <!-- 搜索部分开始 -->
                            <c:if test="${sessionScope.user == null}">
                            <div class="header-search-form-wrapper">
                                <a href="${pageContext.request.contextPath}/userInfoController/login"><button class="theme-btn-s2">登录</button></a>
                            </div>
                            <div class="header-search-form-wrapper">
                                <a href="${pageContext.request.contextPath}/userInfoController/login"><button class="theme-btn-s2">注册</button></a>
                            </div>
                            </c:if>
                            <c:if test="${sessionScope.user != null}">
                                <button class="theme-btn-s2">
                                    <!-- 这儿放头像 -->
                                    <!-- 默认头像 -->
                                    <c:if test="${sessionScope.user.userImg ==null}">
                                        <img id='uimg' src="#"/>
                                    </c:if>
                                    <!-- 自定义头像 -->
                                    <c:if test="${sessionScope.user.userImg !=null}">
                                        <img id='uimg'   src="${pageContext.request.contextPath }/DownLoadController/download/?filename=${sessionScope.user.userImg}" />
                                    </c:if>
                                </button>
                                <button class="theme-btn-s2"><h5 style="color: #FFFFFF">${sessionScope.user.userName}</h5></button>
                                <a href="${pageContext.request.contextPath}/frontController/userCenter"><button class="theme-btn-s2">资料</button></a>
                                <a href="${pageContext.request.contextPath}/userInfoController/exit"><button class="theme-btn-s2">退出</button></a>
                            </c:if>
                            <!-- 搜索部分结束 -->
                            <!-- 个人中心 -->
                            <%--<div class="mini-cart">
                                <a href="${pageContext.request.contextPath}/frontController/userCenter">
                                    <button class="cart-toggle-btn">
                                        <i class="fi flaticon-shopping-cart"></i>
                                    </button>
                                </a>
                            </div>--%>
                        </div>
                    </div><!-- 个人中心结束 -->
                </nav>
            </div>
        </header>
        <!-- 头部结束 -->
        <!-- 头部图片轮播 部分开始   暂时不修改 -->
        <section class="hero hero-style-2">
            <div class="hero-slider">
                <div class="slide">
                    <div class="container">
                        <img src="${pageContext.request.contextPath}/images/slider/slide-4.jpg" alt class="slider-bg">
                        <div class="row">
                            <div class="col col-md-8 slide-caption">
                                <div class="slide-title">
                                    <h2>维也纳酒店</h2>
                                </div>
                                <div class="slide-subtitle">
                                    <p>让你的体验更加美好</p>
                                </div>
                                <div class="btns">
                                    <a href="#" class="theme-btn">去预定</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="slide">
                    <div class="container">
                        <img src="${pageContext.request.contextPath}/images/slider/slide-5.jpg" alt class="slider-bg">
                        <div class="row">
                            <div class="col col-md-8 slide-caption">
                                <div class="slide-title">
                                    <h2>维也纳酒店</h2>
                                </div>
                                <div class="slide-subtitle">
                                    <p>让你的体验更加美好</p>
                                </div>
                                <div class="btns">
                                    <a href="#" class="theme-btn">去预定</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="slide">
                    <div class="container">
                        <img src="${pageContext.request.contextPath}/images/slider/slide-6.jpg" alt class="slider-bg">
                        <div class="row">
                            <div class="col col-md-8 slide-caption">
                                <div class="slide-title">
                                    <h2>维也纳酒店</h2>
                                </div>
                                <div class="slide-subtitle">
                                    <p>让你的体验更加美好</p>
                                </div>
                                <div class="btns">
                                    <a href="#" class="theme-btn">去预定</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="slide">
                    <div class="container">
                        <img src="${pageContext.request.contextPath}/images/slider/slide-7.jpg" alt class="slider-bg">
                        <div class="row">
                            <div class="col col-md-8 slide-caption">
                                <div class="slide-title">
                                    <h2>维也纳酒店</h2>
                                </div>
                                <div class="slide-subtitle">
                                    <p>让你的体验更加美好</p>
                                </div>
                                <div class="btns">
                                    <a href="#" class="theme-btn">去预定</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- 头部图片轮播结束 -->
        <!-- 搜索部分开始 -->
        <div class="wpo-select-section">
            <div class="container">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="wpo-select-wrap">
                            <div class="wpo-select-area">
                                <form class="clearfix" method="post" action="${pageContext.request.contextPath}/frontController/checkinDate">
                                    <div class="select-sub">
                                        <span><i class="fi flaticon-calendar"></i>入住时间</span>
                                        <div class="form-group">
                                            <div id="filterDate">
                                                <!-- Datepicker as text field -->
                                                <div class="input-group date" data-date-format="yyyy-mm-dd">
                                                    <input type="text" name="begin" class="form-control" placeholder="01.06.2020">
                                                    <div class="input-group-addon">
                                                        <span class="ti-angle-down"></span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="select-sub">
                                        <span><i class="fi flaticon-calendar"></i>退房时间</span>
                                        <div class="form-group">
                                            <div id="filterDate2">
                                                <!-- Datepicker as text field -->
                                                <div class="input-group date" data-date-format="yyyy-mm-dd">
                                                    <input type="text" name="end" class="form-control" placeholder="01.06.2020">
                                                    <div class="input-group-addon">
                                                        <span class="ti-angle-down"></span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="select-sub">
                                        <span> <i class="fi flaticon-user"></i>成人</span>
                                        <select name="people" class="select wide">
                                            <option>02</option>
                                            <option>01</option>
                                            <option>03</option>
                                            <option>04</option>
                                            <option>05</option>
                                            <option>06</option>
                                        </select>
                                    </div>
                                    <div class="select-sub">
                                        <span> <i class="fi flaticon-user"></i>孩子</span>
                                        <select name="child" class="select wide">
                                            <option>01</option>
                                            <option>02</option>
                                            <option>03</option>
                                            <option>04</option>
                                            <option>05</option>
                                            <option>06</option>
                                        </select>
                                    </div>
                                    <div class="select-sub">
                                        <button class="theme-btn-s2" type="submit" >入住</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 搜索部分结束 -->
        <!-- 酒店介绍开始 -->
        <div class="wpo-about-area-2 section-padding">
            <div class="container">
                <div class="row">
                    <div class="col-lg-6 col-md-6 col-sm-12 col-12">
                        <div class="wpo-about-img">
                            <img src="${pageContext.request.contextPath}/images/about/2.jpg" alt="">
                        </div>
                    </div>
                    <div class="col-lg-6 col-md-6 col-sm-12 col-12">
                        <div class="wpo-about-text">
                            <div class="wpo-section-title">
                                <span>关于我们</span>
                                <h2>您的最佳选择</h2>
                            </div>
                            <p>用最诚挚的服务带给你不同的感受,欢迎你的入住!</p>
                            <div class="btns">
                                <a href="${pageContext.request.contextPath}/frontController/service" class="theme-btn-s2" tabindex="0">查看更多</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 酒店介绍结束 -->
        <!-- 选择城市  暂时不需修改 -->
        <div class="destination-service section-padding">
            <div class="container">
                <div class="col-12">
                    <div class="wpo-section-title text-center">
                        <span></span>
                        <h2>我们的位置</h2>
                    </div>
                </div>
                <a id="a1"></a>
                <div class="col-lg-1"></div>
                <div class="col-lg-10" id="allmap" style="height: 600px"></div>
                <div class="col-lg-1"></div>
        <%--<div class="wpo-about-area-2 section-padding">
        <a id="a1"></a>
        <div class="col-lg-2"></div>
        <div class="col-lg-8" id="allmap" style="height: 600px"></div>
        <div class="col-lg-2"></div>
        </div>--%>
            </div>
        </div>
        <!-- 城市部分结束 -->
        
        <!--精选部分开始-->
        <section class="Room-area section-padding">
            <div class="Room-section">
                <div class="container">
                    <div class="col-12">
                        <div class="wpo-section-title">
                            <span>房间</span>
                            <h2>房间列表</h2>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col col-xs-12 sortable-gallery" id="allRoom">
                            <%--<div class="gallery-filters">
                                <ul id="roomType">
                                    <li><a data-filter=".Classic" name="spc" value="4" class="current">全部</a></li>
                                    &lt;%&ndash;<li><a data-filter=".Classic" href="#" class="current">房间类型名</a></li>
                                    <li><a data-filter=".Budget" name="spc" value="1">双人房</a></li>
                                    <li><a data-filter=".Luxury" href="#">情侣房</a></li>
                                    <li><a data-filter=".Double" href="#">豪华房</a></li>
                                    <li><a data-filter=".Single" href="#">总统房</a></li>&ndash;%&gt;
                                </ul>
                            </div>--%>
                            <div class="gallery-container gallery-fancybox masonry-gallery" id="roomDiv">
                                <%--<div class="grid">
                                    <div class="room-item">
                                        <img src="${pageContext.request.contextPath}/images/room/img-1.jpg" alt class="img img-responsive">
                                        <div class="room-text-show">
                                            <h2>Lake view Room</h2>
                                        </div>
                                        <div class="room-text-hide">
                                            <h2>房间类型</h2>
                                            <span>房间号码</span>
                                            <p>房间简介</p>
                                            <small>From: <span>价钱</span> / 晚</small>
                                            <small>From: <span>电话</span></small>
                                            <a class="theme-btn-s2" href="#">Check Availability</a>
                                        </div>
                                    </div>
                                </div>--%>

                            </div>
                        </div>
                    </div> <!-- end row -->
                </div>
            </div>
        </section>
        <!--精选房间部分结束-->

        <!-- 首页评论部分 -->
        <div class="testimonial-area section-padding">
            <div class="container">
                <div class="col-12">
                    <div class="wpo-section-title">
                        <span>评价</span>
                        <h2>你们的评价对我们很重要</h2>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-12">
                        <div class="testimonial-slider clearfix" id="userCom">

                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 评论部分结束 -->
        <!-- 底部部分 -->
        <footer class="wpo-site-footer">
            <div class="wpo-upper-footer">
                <div class="wpo-footer-top">
                    <div class="container">
                        <div class="row">
                            <div class="col-lg-6 col-md-6 col-sm-6 col-12 custom-grid">
                                <div class="logo widget-title">
                                    <img src="${pageContext.request.contextPath}/images/logo.png" alt="blog">
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-12 custom-grid">
                                <ul>
                                    <li><a href="#"><i class="ti-facebook"></i></a></li>
                                    <li><a href="#"><i class="ti-twitter-alt"></i></a></li>
                                    <li><a href="#"><i class="ti-instagram"></i></a></li>
                                    <li><a href="#"><i class="ti-google"></i></a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="footer-middle">
                    <div class="container">
                        <div class="row">
                            <div class="col col-lg-3 col-md-3 col-sm-6">
                                <div class="widget market-widget wpo-service-link-widget">
                                    <div class="widget-title">
                                        <h3>Contact </h3>
                                    </div>
                                    <p>online store with lots of cool and exclusive features</p>
                                    <div class="contact-ft">
                                        <ul>
                                            <li><i class="fi ti-location-pin"></i>28 Street, New York City, USA</li>
                                            <li><i class="fi ti-mobile"></i>+000123456789</li>
                                            <li><i class="fi flaticon-email"></i>Hastium@gmail.com</li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="col col-lg-3 col-md-3 col-sm-6">
                                <div class="widget link-widget resource-widget">
                                    <div class="widget-title">
                                        <h3>Destination</h3>
                                    </div>
                                    <div class="news-wrap">
                                        <div class="news-img">
                                            <img src="${pageContext.request.contextPath}/images/footer/img-1.jpg" alt="">
                                        </div>
                                        <div class="news-text">
                                            <h3>Paris, France</h3>
                                            <span>11 Jun 2020 - 22 Jun 2020</span>
                                            <h2>$835</h2>
                                        </div>
                                     </div>
                                    <div class="news-wrap">
                                        <div class="news-img">
                                            <img src="${pageContext.request.contextPath}/images/footer/img-2.jpg" alt="">
                                        </div>
                                        <div class="news-text">
                                            <h3>San Francisco</h3>
                                            <span>11 Jun 2020 - 22 Jun 2020</span>
                                            <h2>$835</h2>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col col-lg-3 col-md-3 col-sm-6">
                                <div class="widget link-widget">
                                    <div class="widget-title">
                                        <h3>Useful Links</h3>
                                    </div>
                                    <ul>
                                        <li><a href="about.html">About Us</a></li>
                                        <li><a href="room.html">Our Offers</a></li>
                                        <li><a href="service.html">How Spread</a></li>
                                        <li><a href="contact.html">Contact Us</a></li>
                                        <li><a href="service-single.html">Our Event</a></li>
                                    </ul>
                                </div>
                            </div>
                            <div class="col col-lg-3 col-md-3 col-sm-6">
                                <div class="widget newsletter-widget">
                                    <div class="widget-title">
                                        <h3>Newsletter</h3>
                                    </div>
                                    <form>
                                        <div class="input-1">
                                            <input type="email" class="form-control" placeholder="Email Address *" required="">
                                        </div>
                                        <div class="submit clearfix">
                                            <button type="submit">subscribe<i class="ti-angle-right"></i></button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div> <!-- end container -->
                </div>
            </div>
            <div class="wpo-lower-footer">
                <div class="container">
                    <div class="row">
                        <div class="col col-md-6 col-sm-6">
                            <div class="term">
                                <ul>
                                    <li><a href="#">Privecy Policy</a></li>
                                    <li><a href="#">Terms & Condition</a></li>
                                    <li><a href="#">Cookies</a></li>
                                </ul>
                            </div>
                        </div>
                        <div class="col col-md-6 col-sm-6">
                            <p class="copyright">Copyright &copy; 2020.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></p>
                        </div>
                    </div>
                </div>
            </div>
        </footer>
        <!-- 底部部分结束 -->
    </div>
    <!-- All JavaScript files
    ================================================== -->
    <script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/owl.carousel.min.js"></script>
    <!-- Plugins for this template -->
    <script src="${pageContext.request.contextPath}/js/jquery-plugin-collection.js"></script>
    <script src="${pageContext.request.contextPath}/js/bootstrap-datepicker.min.js"></script>
    <!-- Custom script for this template -->
    <script src="${pageContext.request.contextPath}/js/script.js"></script>
</body>
<script type="text/javascript">
    $(function () {
        var con="";
        /*$.get("/RoomTypeController/queryRtNameRoomType",function(data){
            $.each(data,function(index,type){
                /!*content+="<li><a data-filter=\".Classic\" class=\"current\">"+data[index].rtName+"</a></li>"*!/
                content+="<li><a data-filter=\".Budget\" name=\"spc\" value=\"1\">"+data[index].rtName+"</a></li>";
            })
            $("#roomType").append(content);
        })*/
        //发送ajax请求 获取用户评论
        $.ajax({
            url:"${pageContext.request.contextPath}/comments/getUserCom",
            type:"GET",
            dataType:"json",
            success:function(data){
                for(var i=0;i<data.length;i++){
                    con+="<div class=\"owl-item cloned\" style=\"width: 350px; margin-right: 30px;\"><div class=\"grid\">\n" +
                        "                                <div class=\"quote\">\n" +
                        "                                    <p>"+data[i].comText+"</p>\n" +
                        "                                </div>\n" +
                        "                                <div class=\"client-info\">\n" +
                        "                                    <div class=\"client-img\">\n" +
                        "                                        <img src=\"${pageContext.request.contextPath }/DownLoadController/download/?filename="+data[i].user.userImg+"\" alt=\"\">\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"client-text\">\n" +
                        "                                        <h5>"+data[i].user.userName+"</h5>\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                            </div></div>";
                }
                $("#userCom").html(con);
            }
        })
        //发送ajax请求
        $.ajax({
            async : true,
            type : "POST",
            url : "${pageContext.request.contextPath}/viewRoomInfo/getAllRoom",
            dataType:"json",
            success : function (data) {
                var content = "";
                //遍历
                $.each(data,function (index,obj) {
                        content += "<div class=\"grid\">\n" +
                            "                                    <div class=\"room-item\">\n" +
                            "                                        <img id='uimg'   src=\"${pageContext.request.contextPath }/DownLoadController/download/?filename="+obj.roomImg+"\" />\n" +
                            "                                        <div class=\"room-text-show\">\n" +
                            "                                            <h2>"+obj.rtName+"</h2>\n" +
                            "                                        </div>\n" +
                            "                                        <div class=\"room-text-hide\">\n" +
                            "                                            <h2>"+obj.rtName+"</h2>\n" +
                            "                                            <span>"+obj.roomNum+"</span>\n" +
                            "                                            <p style=\"display: -webkit-box;\n" +
                            "-webkit-box-orient: vertical;\n" +
                            "-webkit-line-clamp: 2;\n" +
                            "overflow: hidden;\">"+obj.remark+"</p>\n" +
                            "                                            <small>价钱: ￥<span>"+obj.rtPrice+"</span> / 晚</small>\n" +
                            "                                            <small>房间电话: <span>"+obj.roomTel+"</span></small>\n" +
                            "                                            <a class=\"theme-btn-s2\" href=\"${pageContext.request.contextPath}/frontController/roomSingle?rtName="+obj.rtName+"\">查看</a>\n" +
                            "                                        </div>\n" +
                            "                                    </div>\n" +
                            "                                </div>";
                    })
                //填充到指定的标签中
                $("#roomDiv").html(content);
            },
            error : function() {
                alert("异步请求失败~");
            }
        })
        //鼠标移上去事件,按f12观察,改样式
        $(document).on("mouseover", ".menu_box", function() {
            $(this).find(".menu_sub").removeClass("dn");
            $(this).addClass("current");
        })
        //鼠标移出去事件
        $(document).on("mouseout", ".menu_box", function() {
            $(this).find(".menu_sub").addClass("dn");
            $(this).removeClass("current");
        })
        //对选择框做判断
        $("#searchType").click(function () {
            var spc = $(".type_selected").text();
            //alert(spc)
            if (spc=="房间"){
                $(".form_url").attr("action","room.jsp");
            }else {
                //跳转到房间类型
                $(".form_url").attr("action","room-single.jsp")
            }
        })

    })
    function two(roomInfoList) {
        var content1 = "";
        //遍历
        $.each(roomInfoList,function (index,obj) {
                content1 += "      						<dl class=\"reset\">\r\n"
                        + "								<dt>\r\n"
                        + "									<a href=\"h/roomtype/list_房间类型?labelWords=label\"> "
                        + obj.tname1 + "</a>\r\n"
            })
        return content1;
    }
</script>
</html>
<script type="text/javascript">
    /*获取酒店位置*/
    var address = $("#address").text();
    // 百度地图API功能
    var map = new BMap.Map("allmap");
    var point = new BMap.Point(116.331398,39.897445);
    map.centerAndZoom(point,12);
    setTimeout(function(){
        map.setZoom(14);
    }, 2000);  //2秒后放大到14级
    map.enableScrollWheelZoom(true);
    var geolocation = new BMap.Geolocation();
    geolocation.getCurrentPosition(function(r){
        if(this.getStatus() == BMAP_STATUS_SUCCESS){
            var mk = new BMap.Marker(r.point);
            map.addOverlay(mk);
            map.panTo(r.point);
            /*alert('您的位置：'+r.point.lng+','+r.point.lat);*/
            var p1 = new BMap.Point(r.point.lng,r.point.lat);
            // 创建地址解析器实例
            var myGeo = new BMap.Geocoder();
            // 将地址解析结果显示在地图上,并调整地图视野
            myGeo.getPoint(address, function(point){
                if (point) {
                    map.centerAndZoom(point, 16);
                    map.addOverlay(new BMap.Marker(point));
                    var p2 = new BMap.Point(point.lng,point.lat);
                    /*alert('您的位置：'+point.lng+','+point.lat);*/
                    var driving = new BMap.DrivingRoute(map, {renderOptions:{map: map, autoViewport: true}});
                    driving.search(p1, p2);
                }else{
                    alert("您选择地址没有解析到结果!");
                }
            }, "西安市");

        }
        else {
            alert('failed'+this.getStatus());
        }
    },{enableHighAccuracy: true})
    //关于状态码
    //BMAP_STATUS_SUCCESS	检索成功。对应数值“0”。
    //BMAP_STATUS_CITY_LIST	城市列表。对应数值“1”。
    //BMAP_STATUS_UNKNOWN_LOCATION	位置结果未知。对应数值“2”。
    //BMAP_STATUS_UNKNOWN_ROUTE	导航结果未知。对应数值“3”。
    //BMAP_STATUS_INVALID_KEY	非法密钥。对应数值“4”。
    //BMAP_STATUS_INVALID_REQUEST	非法请求。对应数值“5”。
    //BMAP_STATUS_PERMISSION_DENIED	没有权限。对应数值“6”。(自 1.1 新增)
    //BMAP_STATUS_SERVICE_UNAVAILABLE	服务不可用。对应数值“7”。(自 1.1 新增)
    //BMAP_STATUS_TIMEOUT	超时。对应数值“8”。(自 1.1 新增)
</script>